home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
telecomm
/
sticpsrc.lzh
/
SOURCE.ARC
/
CRTSPEC.S
< prev
next >
Wrap
Text File
|
1988-02-15
|
1KB
|
46 lines
/
/ ST C run time startup.
/
/ Special version for compilation of NET as a desktop accessory
/ main called with argc == argv == envp == 0,
/ getenv will not work,
/ file handle 2 left pointing where ever it does.
/
.prvd
.globl errno_
.globl environ_
.globl _start_
errno_: .word 0
environ_: .long 0
/
/ a1 = end of bssd
/ a5 = base page pointer
/ _start_ = program text base
/
.shri
_start_:
/ Load the stack pointer with our stack
movea.l $__ESTACK__,a7
/ Push arguments for main(argc, argv, envp)
move.l a5, -(a7) / basepage
clr.l -(a7) / envp[]
clr.l -(a7) / argv[]
clr -(a7) / argc
/ Call main(argc, argv, envp)
suba a6, a6 / Zero frame pointer
jsr main_ / Call main line
adda $14, a7 / Pop arguments
/ Exit with return from main
move d0, -(a7) / Push status
jsr exit_ / Call extended exit()
clr -(a7) / Function 0
trap $1 / Gemdos (Pterm0())
.bssd
.even
__USTACK__:
.blkw 1600 / this is the stack size
__ESTACK__:
.blkl 1